package com.erp.serviceImpl.baseDataServiceImpl;

import com.erp.dao.MaterialCategoryMapper;
import com.erp.pojo.MaterialCategory;
import com.erp.pojo.MaterialCategoryExample;
import com.erp.service.baseDataService.MaterialCateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MaterialCateServiceImpl implements MaterialCateService {

    @Autowired
    private MaterialCategoryMapper materialCategoryMapper;


    @Override
    public List<MaterialCategory> select(short categorylevel) {

        MaterialCategoryExample example = new MaterialCategoryExample();

        MaterialCategoryExample.Criteria createCriteria = example.createCriteria();

        if (categorylevel==1){
            createCriteria.andCategorylevelEqualTo(categorylevel);
        }else if(categorylevel==2){
            createCriteria.andCategorylevelEqualTo(categorylevel);
        }else if(categorylevel==3){
            createCriteria.andCategorylevelEqualTo(categorylevel);
        }

        return materialCategoryMapper.selectByExample(example);
    }
}
